package com.xiaotao.commons.common;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author xiaotao
 */
@RestControllerAdvice
public class GlobalException {

    @ExceptionHandler
    public R<String> commonException(Exception e){
        return R.fail(e.getMessage(),e.toString());
    }
}
